//
//  DestWebViewViewController.m
//  TravelEveryDay
//
//  Created by dlios on 15/10/23.
//  Copyright © 2015年 com.lanou3g. All rights reserved.
//

#import "DestWebViewViewController.h"
#import "BaseHeader.h"
@interface DestWebViewViewController ()
@property(nonatomic,strong)UIWebView *destWebView;
@end

@implementation DestWebViewViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor whiteColor];
    self.navigationController.navigationBarHidden = NO;
    self.tabBarController.tabBar.hidden = YES;
    UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
    button.frame =CGRectMake(5, 20, 30, 30);
    [button setImage:[UIImage imageNamed:@"play-jiantouzuo.png"] forState:UIControlStateNormal];
    [button addTarget:self action:@selector(DestGoBack) forControlEvents:UIControlEventTouchUpInside];
    
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc]initWithCustomView:button];
    UIColor * color = [UIColor whiteColor];
    //这里我们设置的是颜色，还可以设置shadow等，具体可以参见api
    NSDictionary * dict = [NSDictionary dictionaryWithObject:color forKey: NSForegroundColorAttributeName];
    //大功告成
    self.navigationController.navigationBar.titleTextAttributes = dict;
    ////navgation的title的字符串赋值
    self.title = _titleStr;
    [self createWebView];
    
    
}
#pragma mark - 创建webView
- (void)createWebView {
    _destWebView = [[UIWebView alloc]initWithFrame:CGRectMake(0, 0  , SCREEN_WIDTH, SCREEN_HEIGHT )];
    _destWebView.scrollView.showsHorizontalScrollIndicator = NO;
    NSURL *url = [NSURL URLWithString:_webStr];
    NSURLRequest *request = [NSURLRequest requestWithURL:url];
    [_destWebView  loadRequest:request];
    [self.view addSubview:_destWebView];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
#pragma mark - 返回方法
- (void)DestGoBack {
    [self.navigationController popViewControllerAnimated:YES];
}
/*
 #pragma mark - Navigation
 
 // In a storyboard-based application, you will often want to do a little preparation before navigation
 - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
 // Get the new view controller using [segue destinationViewController].
 // Pass the selected object to the new view controller.
 }
 */

@end
